<!--{eval $_TPL['titles'] = array($unionthread['subject'], $union['tagname'], $union['title'], '话题');}-->
<!--{template header}-->

<div class="tabs_header">
	<ul class="tabs">
		<!--{if $eventid}-->
		<li><a href="space.php?do=event&id=$eventid&view=unionthread"><span>返回动态列表</span></a></li>
		<!--{else}-->
		<li><a href="space.php?do=union&tagid=$unionthread[tagid]&view=list"><span>返回动态列表</span></a></li>
		<!--{/if}-->
		<!--{if $eventid}-->
			<!--{if $event[grade] > 0 && $userevent[status]>=2}-->
		<li><a href="cp.php?ac=unionthread&tagid=$union[tagid]&eventid=$eventid"><span>发起新话题</span></a></li>
			<!--{/if}-->
		<!--{elseif empty($union['ismember']) && $union['joinperm'] < 2}-->
		<li><a href="cp.php?ac=union&op=join&tagid=$union[tagid]" id="union_join_$union[tagid]" onclick="ajaxmenu(event, this.id)"><span>加入该公司</span></a></li>
		<!--{elseif $union['allowpost']}-->
		<li><a href="cp.php?ac=unionthread&tagid=$union[tagid]"><span>发起新话题</span></a></li>
		<!--{/if}-->
	</ul>
	<!--{if $_SGLOBAL[refer]}-->
	<div class="r_option">
		<a  href="$_SGLOBAL[refer]">&laquo; 返回上一页</a>
	</div>
	<!--{/if}-->
</div>

<div id="div_post">

	<div class="board">
		<!--{if $unionthread[content]}-->
		<div id="post_$unionthread[content][pid]_li">
			<ul class="line_list">
				<li>
				<table width="100%">
					<tr>
						<td width="70" valign="top">
							<div class="avatar48">
							<a href="space.php?uid=$unionthread[uid]"><!--{avatar($unionthread[uid],small)}--></a>
							</div>
						</td>
						<td>
							<div class="title">
								<!-- <a href="cp.php?ac=share&type=unionthread&id=$unionthread[tid]" id="a_share" onclick="ajaxmenu(event, this.id, 1)" class="a_share">分享</a>
								<div class="r_option">
									<a href="cp.php?ac=common&op=report&idtype=tid&id=$unionthread[tid]" id="a_report" onclick="ajaxmenu(event, this.id, 1)">举报</a><span class="pipe">|</span>
								</div> -->

								<!--{eval $magicegg = ""}-->
								<!--{eval if($unionthread[magicegg]) for($i=0; $i<$unionthread[magicegg]; $i++) $magicegg .= '<img src="image/magic/egg/'.mt_rand(1,6).'.gif" />';}-->
								<h1 <!--{if $unionthread[magiccolor]}--> class="magiccolor$unionthread[magiccolor]"<!--{/if}--> >$magicegg $unionthread[subject]</h1>
								<!--{if $unionthread[hot]}--><span class="hot"><em>热</em>$unionthread[hot]</span><!--{/if}-->
								<a href="space.php?uid=$unionthread[uid]">{$_SN[$unionthread[uid]]}</a>
								<span class="gray"><!--{date('Y-m-d H:i',$unionthread[dateline],1)}--></span>

								<!--{if !$eventid && $unionthread[eventid] && $event}-->
								<p style="padding:5px 0;"><strong>来自活动</strong>：<a href="space.php?do=event&id=$event[eventid]&view=unionthread">$event[title]</a></p>
								<!--{/if}-->
							</div>

							<div class="detail" id="detail_0">
								<!--{if $_SGLOBAL['ad']['rightside']}-->
								<div style="float: right; padding:5px;"><!--{ad/rightside}--></div>
								<!--{/if}-->
								$unionthread[content][message]
								<!--{if $unionthread[content][pic]}--><div><a href="$unionthread[content][pic]" target="_blank"><img src="$unionthread[content][pic]" alt="" class="resizeimg" /></a></div><!--{/if}-->
							</div>
						</td>
					</tr>
				</table>
				<table width="100%">
					<tr>
						<td align="right">
							<!--{if $union[grade]>=8 || $unionthread[uid]==$_SGLOBAL[supe_uid] || ($eventid && $userevent[status]>=3)}-->
							<a href="cp.php?ac=unionthread&op=edit&pid=$unionthread[content][pid]&tagid=$unionthread[tagid]<!--{if $eventid}-->&eventid=$eventid<!--{/if}-->">编辑</a>
							<a href="cp.php?ac=unionthread&op=delete&pid=$unionthread[content][pid]&tagid=$unionthread[tagid]<!--{if $eventid}-->&eventid=$eventid<!--{/if}-->" id="p_$unionthread[content][pid]_delete" onclick="ajaxmenu(event, this.id)">删除</a>
							<!--{/if}-->
							<!--{if checkperm('manageunionthread')}-->
							<a href="cp.php?ac=unionthread&tid=$unionthread[tid]&op=edithot" id="a_hot_$unionthread[tid]" onclick="ajaxmenu(event, this.id)">热度</a><span class="pipe">|</span>
							<!--{/if}-->
							<!--{if (!$eventid && $union[allowpost]) || ($eventid && $userevent[status]>=2)}--><a href="#postform">回复</a>&nbsp;<!--{/if}-->
						</td>
					</tr>
				</table>
				</li>
			</ul>
		</div>

		<!--{/if}-->
		<div class="page">$multi</div>
		<div id="post_ul">
			<!--{if $pid}-->
			<div class="notice">
				当前只显示与你操作相关的单个帖子，<a href="space.php?uid=$unionthread[uid]&do=unionthread&id=$unionthread[tid]<!--{if $eventid}-->&eventid=$eventid<!--{/if}-->">点击此处查看全部回帖</a>
			</div>
			<!--{/if}-->

			<!--{loop $list $value}-->
			<!--{template space_post_li}-->
			<!--{/loop}-->
		</div>

		<div class="page">$multi</div>

		<!--{if (!$eventid && $union[allowpost]) || ($eventid && $userevent[status]>1)}-->

		<div class="quickpost" id="postform">
			<form method="post" action="cp.php?ac=unionthread<!--{if $eventid}-->&eventid=$eventid<!--{/if}-->" class="quickpost" id="quickpostform_{$unionthread[tid]}" name="quickpostform_{$unionthread[tid]}">
				<table>
					<tr>
						<td>
							<textarea id="message" name="message" onkeydown="ctrlEnter(event, 'postsubmit_btn');" col="50" rows="6" style="width: 430px; height: 6em;"></textarea>
							<a href="###" id="quickpost" onclick="showFace(this.id, 'message');return false;"><img src="image/facelist.gif" align="absmiddle" /></a>
						</td>
					</tr>
					<tr>
						<td>插入图片</td>
					</tr>
					<tbody id="quickpostimg">
						<tr>
							<td>
								<input type="text" name="pics[]" onfocus="if(this.value == 'http://')this.value='';" onblur="if(this.value=='')this.value='http://'" value="http://" class="t_input" size="55" style="width: 350px" />&nbsp;
								<a href="javascript:;" onclick="insertWebImg(this.previousSibling.previousSibling)">插入</a> &nbsp;
								<a href="javascript:;" onclick="delRow(this, 'quickpostimg')">删除</a>
							</td>
						</tr>
					</tbody>
					<tr>
						<td><a href="javascript:;" onclick="copyRow('quickpostimg')">+增加图片</a> <span class="gray">只支持 .jpg、.gif、.png为结尾的URL地址</span></td>
					</tr>
					<tr>
						<td>
							<input type="hidden" name="tid" value="$unionthread[tid]" />
							<input type="hidden" name="postsubmit" value="true" />
							<input type="button" id="postsubmit_btn" name="postsubmit_btn" value="回复" class="submit" onclick="ajaxpost('quickpostform_{$unionthread[tid]}', 'post_add')" />
							<div id="__quickpostform_{$unionthread[tid]}"></div>
						</td>
					</tr>
				</table>
				<input type="hidden" name="formhash" value="<!--{eval echo formhash();}-->" />
			</form>
		</div>
		<!--{else}-->
		<div class="c_form">
			<!--{if $eventid}-->
				只有活动成员可以回复活动话题
			<!--{elseif $union[grade]==-1}-->
				您现在被群主禁言，不能参与讨论。
			<!--{else}-->
				你还不是该公司正式成员，不能参与讨论。
				<!--{if $union[grade]==-9}-->
				<a href="cp.php?ac=union&op=join&tagid=$union[tagid]" id="_tag_join_$union[tagid]" onclick="ajaxmenu(event, this.id)">现在就加入</a>。
				<!--{/if}-->
			<!--{/if}-->
		</div>
		<!--{/if}-->
	</div>
</div>

<script type="text/javascript">
	resizeImg('div_post','600');
</script>

<!--{template footer}-->